<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script>
    <script>
        function ss() {
//            var form = document.getElementById("f");
//            form.action = 'http://localhost:8080/login?name=' + document.getElementById('name').value;
//            alert(form.action);
//            form.submit();
            window.location.href='http://localhost:8080/login?name=' + document.getElementById('name').value;
        }
        $(function () {
            $.ajax({
                type:"get",
                url:"ip/check",
                success:function (json) {
                    if (json.uid != null){
                        alert("你已经注册过了");
                        window.location.href = 'http://localhost:8080/index.jsp?uid=' + json.uid;
                    }
                }
            })
        })
    </script>
</head>

<body>
    <form id="f" method="get">
        <input id = "name" value="昵称"/>
        <input type="button" onclick="ss()">
    </form>
</body>
</html>

